﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.OleDb;
using System.Windows.Forms;

namespace 会员卡管理系统
{
    class getConnection
    {
        public OleDbConnection OledCon()
        {
            //创建连接数据库的字符串
            string reportpath = Application.StartupPath.Substring(0,
                Application.StartupPath.Substring(0, Application.StartupPath.LastIndexOf("\\")).LastIndexOf("\\"));
            reportpath += @"\Database\Vip_Manage.mdb";
            string ConStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" + reportpath;
            //创建oledbconnection对象
            OleDbConnection con = new OleDbConnection(ConStr);
            //con.Open();
            //MessageBox.Show("OK");
            //con.Close();
            //MessageBox.Show("NO");
            return con;
        }
    }
}
